package net.schmurgon.gwt.scaffold.generated;

import com.google.gwt.app.client.EditorSupport;
import com.google.gwt.app.client.DoubleBox;
import com.google.gwt.app.client.IntegerBox;
import com.google.gwt.app.client.LongBox;
import com.google.gwt.app.place.RecordEditView;
import com.google.gwt.core.client.GWT;
import com.google.gwt.dom.client.DivElement;
import com.google.gwt.dom.client.Element;
import com.google.gwt.dom.client.Style.Display;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.uibinder.client.UiHandler;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.HTMLPanel;
import com.google.gwt.user.client.ui.InlineLabel;
import com.google.gwt.user.datepicker.client.DateBox;
import com.google.gwt.user.client.ui.TextBox;
import com.google.gwt.valuestore.shared.Property;
import com.google.gwt.app.place.ProxyRenderer;

import net.schmurgon.gwt.request.RunnerRecord;
import net.schmurgon.gwt.shared.Gender;

import java.util.Map;
import java.util.Set;

/**
 * Renders {@link RunnerRecord for display to the user. Requires the
 *  property to have been fetched.
 */
public class RunnerRecordRenderer extends ProxyRenderer<RunnerRecord> {
  private static RunnerRecordRenderer INSTANCE;

  public static RunnerRecordRenderer instance() {
    if (INSTANCE == null) {
      INSTANCE = new RunnerRecordRenderer();
    }

    return INSTANCE;
  }

  protected RunnerRecordRenderer() {
    super(new String[] { } );
  }

  public String render(RunnerRecord object) {
    if (object == null) {
      return "";
    }
    return object.getLastName() + " (" + object.getId() + ")";
  }
}
